Repository navigation
impl(quota-plane): stage-3 S6 — re-weighting proposal generator: evidence-packed PRs, PR-only write path - #12762
Merged
Merged
Conversation
…ence-packed PRs, PR-only write path (#12700) Pure generator (src/quota-reweight.ts) over S2's accuracy ledger: two proposal classes (pool-weight shifts inside weighted routes; caution-margin widening from weekly calibration), with named evidence gaps wherever the record cannot ground a change — unscoreable windows carry S2's reasons verbatim, thin series fail the volume gates, and the bare opencode-go pool is excluded as S2's mixing artifact. The PR-only runner (src/quota-reweight-pr.ts) routes every subprocess through an allowlist choke point: gh pr create/list and proposal-branch pushes only — no merge exists in its vocabulary. CLI (scripts/quota-reweight-proposals.ts, strict argv #3352) drafts proposals + report, or opens the PRs with --open-prs. First generated proposal: PR #12761 (NEAR_PCT 85 -> 90), opened by the generator against the S2 backtest ledger.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
added 2 commits
November 23, 2026 01:44
… wall error (#12700) The generator proposed NEAR_PCT 85 -> 90 on evidence that weekly walls arrive systematically EARLY (positive median signed wall error). But a pool reads near at windowPercent >= NEAR_PCT (derive.ts), so raising the threshold enters caution LATER and narrows the band — the opposite of the proposal's rationale (Felix's review of the closed proposal PR #12761). The caution-margin class now derives the step direction from the sign of the grounding pools' median signed wall error: early walls (positive) step the threshold DOWN (85 -> 80, caution entered at a lower measured percent, earlier in the window); late walls (negative) step it UP. Both sides are gated identically (breadth >= 2, >= 1 precision anchor, volume gates); counter-evidence on the opposite side at any volume — materially disagreeing signs — is the named counter-evidence-present gap, never a proposal. A symmetric floor (MARGIN_MIN_PCT = 50, gap margin-at-floor) joins the existing ceiling. Step language states the mechanism (enters caution at a lower/higher measured percent); the word widen is gone. Tests pin all three outcomes: positive -> down, negative -> up, mixed -> gap, plus both bounds.
Member
Author
|
agent-note:v1 The caution-margin direction defect from the review of #12761 is fixed here (commit 652af2f; origin/main merged in, head 0c65353):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #12700 (slice S6 of epic #12694; design D5). Unmerged — for Felix's review.
What this is
The Stage-3 re-weighting proposal generator: the mechanism by which forecast evidence becomes config change only as a pull request (D5 — never silent edits).
src/quota-reweight.ts(pure, no I/O): examines S2's accuracy ledger and produces proposals + named evidence gaps. Two v1 classes:NEAR_PCTone step (the margin class D4 reserves to this mechanism).src/quota-reweight-pr.ts: the PR-only write path. Every subprocess passes one choke point validated against an allowlist —gh pr create/pr list, and git pushes only toquota-proposal/…branches. There is no merge call in its vocabulary; the edit itself is an exact find/replace that must match exactly once or it refuses.scripts/quota-reweight-proposals.ts(package scriptproposals:quota-reweight, strict argv per Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352): draft mode writes per-proposalproposal.json/proposal.md(the evidence pack) /change.patchplus a runreport.md(proposals AND gaps);--open-prsopens the PRs.Evidence discipline (S2's rules, binding)
Unscoreable windows never ground a proposal — the gap carries S2's reasons verbatim. Undefined precision/recall is never read as a number. Volume gates: ≥ 100 scored forecasts, ≥ 20 wall samples. The bare
opencode-gopool is excluded in every window (S2's mixing artifact; per-workspace rows only) and the exclusion is itself reported with its numbers.Demonstration on the real evidence (sandbox venue)
Run against the S2 backtest ledger (20,663 records, 2026-10-20 → 2026-11-23) and the live route config:
caution-margin:NEAR_PCT:85->90— grounded on meta weekly (+4,741 min median signed wall error, 269 scored) and anthropic:claude-pro weekly (+795 min, 273 scored, precision 1.0 anchor); no counter-evidence over the gate.Evidence for this PR
bun test quota-reweight19/19 (incl. refusal tests: unscoreable-with-S2's-reason, insufficient volume, undefined metrics, aggregate-pool exclusion, counter-evidence; allowlist tests refusingpr mergeand push-to-main before anything runs; a fake-runner drive of the full branch+edit+push+create sequence). Neighboursquota-forecast/quota-shadow-placement/quota-anomaly60/60.tsc --noEmitclean.What changes when live rows flow
Nothing in the generator. Its contract is the S2 ledger shape: today the input is the backtest's
--ledger-out; once the laptop aggregator is rebuilt and live ticks accumulate, S7's scoring produces the same ledger from live forecast rows, and--forecast/--shadowjoin the pack from the state dir (their absence is named in the pack until then, as PR #12761's body shows). No schedule is created here — the weekly cadence is S7's (#12701), which will call this generator; that is also when the fleet-schedule-registry entry lands.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.